:root {
  --bg: #0d0d14;
  --card: #13131f;
  --border: #1e1e30;
  --yellow: #f5c842;
  --blue: #4fa8ff;
  --green: #4dffb0;
  --pink: #ff6b9d;
  --purple: #b87aff;
  --orange: #ff9f4a;
  --text: #e8e8f0;
  --muted: #7070a0;
  --sidebar-w: 260px;
}

section {
  margin-left: auto;
  margin-right: auto;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Syne', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(79,168,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79,168,255,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* ===== TOP NAV ===== */
nav.topnav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  background: rgba(13,13,20,0.92); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border); padding: 0 24px;
  height: 56px; display: flex; align-items: center; justify-content: space-between;
}
.nav-logo { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 15px; color: var(--yellow); text-decoration: none; white-space: nowrap; }
.nav-logo span { color: var(--muted); }
.nav-right { display: flex; align-items: center; gap: 20px; }
.nav-links { display: flex; gap: 24px; list-style: none; }
.nav-links a { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--muted); text-decoration: none; letter-spacing: 1px; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 6px; background: none; border: 1px solid var(--border); border-radius: 8px; }
.hamburger span { display: block; width: 20px; height: 2px; background: var(--muted); border-radius: 2px; }
@media (max-width: 900px) { .nav-links { display: none; } .hamburger { display: flex; } }

/* ===== LAYOUT ===== */
.layout { display: flex; padding-top: 56px; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed; top: 56px; left: 0; width: var(--sidebar-w);
  height: calc(100vh - 56px); overflow-y: auto;
  background: rgba(13,13,20,0.97); border-right: 1px solid var(--border);
  padding: 20px 0 40px; z-index: 100; transition: transform 0.3s ease;
}
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.sidebar-back {
  display: flex; align-items: center; gap: 8px;
  margin: 0 14px 16px; padding: 9px 14px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: 10px; font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--muted); text-decoration: none;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.sidebar-back:hover { border-color: var(--yellow); color: var(--yellow); background: rgba(245,200,66,0.06); }
.sidebar-back-arrow { font-size: 14px; }
.sidebar-divider { height: 1px; background: var(--border); margin: 10px 16px; }
.sidebar-section-label {
  font-family: 'JetBrains Mono', monospace; font-size: 9px;
  letter-spacing: 3px; text-transform: uppercase; color: var(--muted);
  padding: 0 16px; margin-bottom: 5px; margin-top: 16px;
}
.sidebar-link {
  display: flex; align-items: center; gap: 9px; padding: 8px 16px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--muted);
  text-decoration: none; border-left: 2px solid transparent;
  transition: color 0.2s, background 0.2s, border-left-color 0.2s;
}
.sidebar-link:hover { color: var(--text); background: rgba(255,255,255,0.03); border-left-color: var(--border); }
.sidebar-link.active { color: var(--orange); background: rgba(255,159,74,0.05); border-left-color: var(--orange); }
.s-icon { font-size: 13px; width: 16px; text-align: center; flex-shrink: 0; }
.s-badge { margin-left: auto; font-size: 9px; padding: 1px 5px; border-radius: 8px; background: rgba(255,159,74,0.12); color: var(--orange); }
.sidebar-overlay { display: none; position: fixed; inset: 0; top: 56px; background: rgba(0,0,0,0.6); z-index: 99; }
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
}

/* ===== MAIN ===== */
.main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; position: relative; z-index: 1; }
@media (max-width: 900px) { .main { margin-left: 0; } }

/* ===== PROGRESS BAR ===== */
.progress-bar {
  position: fixed; top: 56px; left: var(--sidebar-w); right: 0; height: 2px;
  background: linear-gradient(90deg, var(--green), var(--orange), var(--pink));
  transform-origin: left; transform: scaleX(0); z-index: 199;
}
@media (max-width: 900px) { .progress-bar { left: 0; } }

/* ===== HERO ===== */
#hero { padding: 76px 48px 60px; max-width: 100%; text-align: center; }
#cta  { padding: 60px 48px 76px; max-width: 100%; text-align: center; }

.hero-badge {
  display: inline-block; background: rgba(255,159,74,0.1);
  border: 1px solid rgba(255,159,74,0.25); color: var(--orange);
  font-size: 11px; letter-spacing: 3px; text-transform: uppercase;
  padding: 6px 16px; border-radius: 20px; margin-bottom: 22px;
  font-family: 'JetBrains Mono', monospace; animation: fadeDown 0.6s ease both;
}
.hero-title {
  font-size: clamp(2.2rem, 6vw, 4.5rem); font-weight: 800; line-height: 1;
  background: linear-gradient(135deg, #4dffb0 0%, #ff9f4a 50%, #b87aff 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  animation: fadeDown 0.6s ease 0.1s both;
}
.hero-sub { font-size: 1rem; color: var(--muted); margin-top: 12px; font-family: 'JetBrains Mono', monospace; animation: fadeDown 0.6s ease 0.2s both; }
.hero-code {
  display: inline-block; margin-top: 30px; background: #080810;
  border: 1px solid var(--border); border-radius: 14px; padding: 20px 28px;
  font-family: 'JetBrains Mono', monospace; font-size: 13px; line-height: 2;
  text-align: left; animation: fadeUp 0.6s ease 0.3s both;
}
.hero-buttons { display: flex; gap: 12px; justify-content: center; margin-top: 28px; flex-wrap: wrap; animation: fadeUp 0.6s ease 0.4s both; }
.btn { padding: 11px 22px; border-radius: 10px; font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; text-decoration: none; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; border: none; display: inline-block; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--orange); color: #0d0d14; box-shadow: 0 4px 20px rgba(255,159,74,0.25); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--orange); color: var(--orange); }

/* ===== SECTIONS ===== */
section { padding: 68px 48px; max-width: 820px; }
@media (max-width: 600px) { section { padding: 50px 20px; } #hero { padding: 56px 20px 44px; } #cta { padding: 44px 20px 60px; } }

.section-label { font-size: 10px; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); font-family: 'JetBrains Mono', monospace; margin-bottom: 10px; }
.section-title-sm { font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); font-family: 'JetBrains Mono', monospace; margin-bottom: 16px; }
.section-heading { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; line-height: 1.15; margin-bottom: 12px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.section-desc { color: var(--muted); font-size: 14px; line-height: 1.75; max-width: 600px; margin-bottom: 24px; }
.section-desc strong { color: var(--text); }

.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--border), transparent); margin: 0 48px; }
@media (max-width: 600px) { .divider { margin: 0 20px; } }

/* TYPE BADGE */
.type-badge {
  display: inline-block; font-family: 'JetBrains Mono', monospace;
  font-size: 13px; font-weight: 700; padding: 3px 10px;
  border-radius: 8px; border: 1px solid; vertical-align: middle;
}

/* ===== SYNTAX COLORS ===== */
.kw { color: var(--pink); font-weight: 700; }
.fn { color: var(--yellow); font-weight: 700; }
.str { color: var(--green); }
.var { color: var(--text); }
.op { color: var(--muted); }
.param { color: var(--blue); }
.num { color: var(--orange); }
.cmt { color: #404060; font-style: italic; }
.line { display: block; }

/* ===== CODE BLOCK ===== */
.code-header {
  display: flex; align-items: center; justify-content: space-between;
  background: #0a0a15; border: 1px solid var(--border);
  border-bottom: none; border-radius: 12px 12px 0 0;
  padding: 10px 18px; margin-top: 20px;
}
.code-header + .code-block { margin-top: 0; border-radius: 0 0 12px 12px; }
.code-dots { display: flex; gap: 6px; }
.code-dot { width: 10px; height: 10px; border-radius: 50%; }
.code-filename { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--muted); }
.code-block {
  background: #080810; border: 1px solid var(--border); border-radius: 12px;
  padding: 20px 24px; font-family: 'JetBrains Mono', monospace;
  font-size: 13px; line-height: 1.9; overflow-x: auto; margin-top: 16px;
}

/* ===== METHODS GRID ===== */
.methods-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 20px;
}
@media (max-width: 700px) { .methods-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 440px) { .methods-grid { grid-template-columns: 1fr; } }

.method-card {
  background: var(--cb, rgba(255,255,255,0.03));
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  transition: border-color 0.2s, transform 0.2s;
}
.method-card:hover { border-color: var(--c, var(--border)); transform: translateY(-2px); }
.method-name { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; color: var(--c, var(--text)); margin-bottom: 5px; }
.method-desc { font-size: 11px; color: var(--muted); line-height: 1.5; }

/* ===== INDEX VISUAL ===== */
.index-visual {
  margin-top: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
}
.index-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.index-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.index-num { font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700; }
.index-val {
  background: #080810;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text);
}
.index-neg { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--muted); }
.index-arrow { color: var(--muted); font-size: 16px; margin-bottom: 4px; }
.index-hint { text-align: center; margin-top: 14px; font-size: 12px; color: var(--muted); font-family: 'JetBrains Mono', monospace; }

/* ===== PROP CARDS (Tupel) ===== */
.compare-half-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}
@media (max-width: 600px) { .compare-half-grid { grid-template-columns: 1fr; } }

.prop-card {
  background: var(--card);
  border: 1px solid;
  border-radius: 14px;
  padding: 22px 24px;
}
.prop-icon { font-size: 22px; margin-bottom: 10px; }
.prop-title { font-weight: 800; font-size: 14px; margin-bottom: 14px; }
.prop-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.prop-list li {
  font-size: 13px; color: var(--muted); line-height: 1.5;
  padding-left: 16px; position: relative;
}
.prop-list li::before { content: '·'; position: absolute; left: 0; color: var(--border); }

/* ===== DICT VISUAL ===== */
.dict-visual {
  margin-top: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  margin-bottom: 20px;
}
.kv-list { display: flex; flex-direction: column; gap: 8px; }
.kv-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  background: #080810;
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}
.kv-key { color: var(--blue); font-weight: 700; min-width: 80px; }
.kv-arrow { color: var(--muted); }
.kv-val { font-weight: 700; }

/* ===== SET OPS VISUAL ===== */
.set-ops-visual {
  margin-top: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
}
.set-ops-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 500px) { .set-ops-grid { grid-template-columns: 1fr; } }

.set-op {
  background: #080810;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  transition: border-color 0.2s;
}
.set-op:hover { border-color: rgba(184,122,255,0.3); }
.set-op-sym { font-family: 'JetBrains Mono', monospace; font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.set-op-name { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.set-op-desc { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ===== COMPARE TABLE ===== */
.compare-table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin-top: 20px;
}
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}
.compare-table th {
  padding: 12px 16px; text-align: left; color: var(--muted);
  font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
  border-bottom: 1px solid var(--border); background: rgba(255,255,255,0.02);
}
.compare-table td {
  padding: 13px 16px; border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}
.compare-table tr:last-child td { border-bottom: none; }
.compare-table tr:hover td { background: rgba(255,255,255,0.02); }
.ds-tag { display: inline-block; padding: 2px 10px; border-radius: 6px; font-size: 11px; font-weight: 700; border: 1px solid; }
.sym-cell { color: var(--muted); font-weight: 700; font-size: 13px; }
.yes-cell { color: var(--green); }
.no-cell { color: var(--pink); }
.desc-cell { color: var(--muted); font-size: 11px; }

/* ===== RULE CARD ===== */
.rule-card {
  background: linear-gradient(135deg, rgba(77,255,176,0.06), rgba(255,159,74,0.06), rgba(184,122,255,0.06));
  border: 1px solid rgba(255,159,74,0.25);
  border-radius: 14px;
  padding: 24px 28px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-top: 20px;
}
.rule-icon { font-size: 28px; flex-shrink: 0; }
.rule-text { font-size: 15px; line-height: 1.7; }
.rule-text strong { color: var(--orange); }

/* ===== CTA ===== */
.cta-box {
  background: linear-gradient(135deg, rgba(77,255,176,0.06), rgba(255,159,74,0.06));
  border: 1px solid rgba(255,159,74,0.2);
  border-radius: 20px; padding: 50px 36px; max-width: 560px; margin: 0 auto;
}
.cta-title {
  font-size: clamp(1.5rem, 4vw, 2.4rem); font-weight: 800; margin-bottom: 12px;
  background: linear-gradient(135deg, var(--green), var(--orange));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.cta-text { color: var(--muted); font-size: 14px; line-height: 1.7; margin-bottom: 22px; }

footer {
  border-top: 1px solid var(--border); padding: 22px 48px;
  text-align: center; font-family: 'JetBrains Mono', monospace;
  font-size: 12px; color: var(--muted); position: relative; z-index: 1;
}
footer span { color: var(--orange); }

/* ===== FADE IN ===== */
.fade-in { opacity: 0; transform: translateY(18px); transition: opacity 0.55s ease, transform 0.55s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ===== ANIMATIONS ===== */
@keyframes fadeDown { from { opacity:0; transform:translateY(-20px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeUp   { from { opacity:0; transform:translateY(20px);  } to { opacity:1; transform:translateY(0); } }